#include <iostream>
#include <string>
class Student
{
public:
    Student()  //无参构造函数
    {
        std::cout<<"无参构造\n";
    }

    Student(int a) //带参构造函数
    {
        std::cout<<"带参构造\n";
        id = a;
    }

    Student(int a,const std::string& b)
    {   
        std::cout<<"2带参构造"<<std::endl;
        id = a;
        name = b;
    }

    Student(const Student& s) //拷贝（复制）构造
    {    
        id = s.id;
        name = s.name;
        std::cout<<"拷贝构造函数"<<std::endl;
    }
    
     void operator=(const Student &s) //成员函数（方法）
    {   
        id = s.id;
        name = s.name;
        std::cout<<id<<"赋值运算符的重载"<<name<<std::endl;
    }

    void show() //成员函数（方法）
    {
        std::cout<<id<<" "<<name<<std::endl;
    }

    ~Student()
    {
        std::cout<<"析构函数!\n";
    }
private:
    int id;
    std::string name;
};



int main()
{   
    // Student s(1,"zhangsan");
    // // Student s1(1);
    // // Student s2(1,"zhangsan");
    // Student s1(s); //Student s1 = s 拷贝构造
    // s1.show();

    return 0;
}